const { WeaSelect,WeaInputSearch,WeaNewScroll } = ecCom;
const { Popconfirm } = antd;
const {inject, observer,Provider} = mobxReact;
const {toJS} = mobx;

@inject('listStore')
@observer
class Toolbar extends React.Component {

  moreFun(){
    const { listStore } = this.props;
    const { topTab,topTab2,topTab3,optionsValue,tabSelectedKey } = listStore;    
    if(optionsValue=='1'){
      window.open(topTab[tabSelectedKey].moreLink)
    }else if(optionsValue=='2'){
      window.open(topTab2[tabSelectedKey].moreLink)
    }else{
      window.open(topTab3[tabSelectedKey].moreLink)
    }
  }
  render() {
    const { params = {},listStore } = this.props;
    const { props = {}, options = {} } = params;



    return (
      <div className="portal-cus-rss-toolbar">
        <ul>
          <li><span onClick={options.handleRefresh}>刷新</span></li>
          <li><span onClick={options.handleSetting}>设置</span></li>
          <li>
            <Popconfirm 
              placement="leftTop" 
              title="此元素被删除后将不能被恢复，是否继续？"
              onConfirm={options.handleDelete} 
              okText="确定"
              cancelText="取消"
            >
              <span>删除</span>
            </Popconfirm>
          </li>
          <li><span onClick={()=>this.moreFun()}>更多</span></li>
        </ul>
      </div>
    );
  }
}
ecodeSDK.exp(Toolbar);
